Class improver
improver provides a set of functions that allow Lua to configure the built-in FTImprover functionality in FTSE.
Note that functions in this class must be called as part of the code executed by the Hooks:OnStart hook, otherwise they will not have the intended effect.
FTImprover module helper functions
| improver:ParseConfig (data) | ParseConfig is used by the FTImprover module to process an FTImprover-formatted configuration or definition file. |
| improver:IsFeatureEnabled (feature) | IsFeatureEnabled will return true if the specified feature was enabled in the FTImprover module configuration. |
Feature toggle flags
| improver:EnableScriptTriggers () | EnableScriptTriggers will enable the "allTriggerConditions" patch behavior as was implemented in FTImprover. |
| improver:EnableGotoMissionFix () | EnableGotoMissionFix will enable the "GOTO_MISSION trigger action" patch behavior as was implemented in FTImprover. |
| improver:EnableMultiProcessFix () | EnableMultiProcessFix will enable the "multipleBOSprocesses" patch behavior as was implemented in FTImprover. |
List management functions
| improver:AddAmmoType (name) | AddAmmoType will add a new ammo type to the current list. |
| improver:ClearAmmoTypes () | ClearAmmoTypes will clear the default list of ammo types in the game, allowing a modification to redefine all available types. |
| improver:AddImpactSound (name) | AddImpactSound will add a new impact sound to the current list. |
| improver:ClearImpactSounds () | ClearImpactSounds will clear the default list of impact sounds in the game, allowing a modification to redefine all available sound entries. |
| improver:AddAnimationName (name) | AddAnimationName will add a new animation name to the current list. |
| improver:ClearAnimationNames () | ClearAnimationNames will clear the default list of animation names in the game, allowing a modification to redefine all available animations. |
| improver:AddWeaponItemType (name) | AddWeaponItemType will add a new weapon item type to the current list. |
| improver:ClearWeaponItemTypes () | ClearWeaponItemTypes will clear the default list of weapon item types in the game, allowing a modification to redefine all available weapon types. |
| improver:AddWeaponSoundType (name) | AddWeaponSoundType will add a new weapon sound type to the current list. |
| improver:ClearWeaponSoundTypes () | ClearWeaponSoundTypes will clear the default list of weapon sound types in the game, allowing a modification to redefine all available weapon sounds. |
| improver:AddAmmoVariant (name, damage, penetration) | AddAmmoVariant will add a new ammo variant to the current list. |
| improver:ClearAmmoVariants () | ClearAmmoVariants will clear the default list of ammo variants in the game, allowing a modification to redefine all available ammo variants. |
| improver:AddAPCT (name, purpose, type, cost) | AddAPCT will add a new action point cost type to the current list. |
| improver:ClearAPCT () | ClearAPCT will clear the default list of action point cost types in the game, allowing a modification to redefine all available action point types. |
| improver:AddAPCT (name, purpose, type, cost) | AddAPCT will add a new action point cost type to the current list. |
| improver:ClearAPCT () | ClearAPCT will clear the default list of action point cost types in the game, allowing a modification to redefine all available action point types. |
| improver:AddArmourType (name) | AddArmourType will add a new armour type to the current list. |
| improver:ClearArmourTypes () | ClearArmourTypes will clear the default list of armour types in the game, allowing a modification to redefine all available armour types. |
Armour rule functions
| improver:AddArmourRule (armour, sex, race, output) | AddArmourRule will add a new armour sprite rule. |
| improver:AddSoundRule (armour, sex, race, output) | AddSoundRule will add a new armour sound rule. |
| improver:DisableDefaultArmourRules () | DisableDefaultArmourRules will remove the built-in armour sprite and sound rules defined in the game code. |
FTImprover module helper functions
These functions are used by the FTImprover module to handle the data files in the original format.
- improver:ParseConfig (data)
-
ParseConfig is used by the FTImprover module to process an FTImprover-formatted configuration or definition file.
A mod using the Lua interface to FTImprover features should not need to use this function.
Parameters:
- data The contents of a FTImprover configuration or definition file.
Returns:
-
None.
- improver:IsFeatureEnabled (feature)
-
IsFeatureEnabled will return true if the specified feature was enabled in the FTImprover module configuration.
This is primarily used by the FTImprover module to keep track of which data files need to be processed,
but could also be useful if a modification provides configuration options that would change the FTImprover
feature set.
Parameters:
- feature The name of the feature to check. Can be one of APCT, AnimationNames, WeaponItemTypes, WeaponSoundTypes, AmmoTypes, AmmoVariants, ArmourTypes, or ImpactSounds.
Returns:
-
True if the feature was enabled.
Feature toggle flags
These functions will enable specific FTImprover features.
- improver:EnableScriptTriggers ()
-
EnableScriptTriggers will enable the "allTriggerConditions" patch behavior as was implemented in FTImprover.
Returns:
-
None.
- improver:EnableGotoMissionFix ()
-
EnableGotoMissionFix will enable the "GOTO_MISSION trigger action" patch behavior as was implemented in FTImprover.
Returns:
-
None.
- improver:EnableMultiProcessFix ()
-
EnableMultiProcessFix will enable the "multipleBOSprocesses" patch behavior as was implemented in FTImprover.
Returns:
-
None.
List management functions
These functions will add or clear items from the internal game lists.
- improver:AddAmmoType (name)
-
AddAmmoType will add a new ammo type to the current list.
Parameters:
- name The name of the new ammo type.
Returns:
-
None.
- improver:ClearAmmoTypes ()
-
ClearAmmoTypes will clear the default list of ammo types in the game, allowing a modification to redefine all available types.
A mod will typically use this function to redefine or replace existing ammo types in the game.
Returns:
-
None.
- improver:AddImpactSound (name)
-
AddImpactSound will add a new impact sound to the current list.
Parameters:
- name The name of the new ammo type.
Returns:
-
None.
- improver:ClearImpactSounds ()
-
ClearImpactSounds will clear the default list of impact sounds in the game, allowing a modification to redefine all available sound entries.
A mod will typically use this function to redefine or replace existing impact sounds in the game.
Returns:
-
None.
- improver:AddAnimationName (name)
-
AddAnimationName will add a new animation name to the current list.
Parameters:
- name The name of the new animation.
Returns:
-
None.
- improver:ClearAnimationNames ()
-
ClearAnimationNames will clear the default list of animation names in the game, allowing a modification to redefine all available animations.
A mod will typically use this function to redefine or replace existing animation names in the game.
Returns:
-
None.
- improver:AddWeaponItemType (name)
-
AddWeaponItemType will add a new weapon item type to the current list.
Parameters:
- name The name of the new weapon item type.
Returns:
-
None.
- improver:ClearWeaponItemTypes ()
-
ClearWeaponItemTypes will clear the default list of weapon item types in the game, allowing a modification to redefine all available weapon types.
A mod will typically use this function to redefine or replace existing weapon item types in the game.
Returns:
-
None.
- improver:AddWeaponSoundType (name)
-
AddWeaponSoundType will add a new weapon sound type to the current list.
Parameters:
- name The name of the new weapon sound type.
Returns:
-
None.
- improver:ClearWeaponSoundTypes ()
-
ClearWeaponSoundTypes will clear the default list of weapon sound types in the game, allowing a modification to redefine all available weapon sounds.
A mod will typically use this function to redefine or replace existing weapon sound types in the game.
Returns:
-
None.
- improver:AddAmmoVariant (name, damage, penetration)
-
AddAmmoVariant will add a new ammo variant to the current list.
Parameters:
- name The name of the new ammo variant.
- damage The damage multiplier percentage adjustment to use for the new ammo variant (positive to increase damage, negative to reduce).
- penetration The penetration multiplier percentage adjustment to use for the new ammo variant (positive to increase penetration, negative to increase resistance).
Returns:
-
None.
- improver:ClearAmmoVariants ()
-
ClearAmmoVariants will clear the default list of ammo variants in the game, allowing a modification to redefine all available ammo variants.
A mod will typically use this function to redefine or replace existing ammo variants in the game.
Returns:
-
None.
- improver:AddAPCT (name, purpose, type, cost)
-
AddAPCT will add a new action point cost type to the current list.
Parameters:
- name The name of the new action point cost type.
- purpose The action type purpose value. 0 is general, 1 is combat, 2 is treatment or repair.
- type The type of action. 0 is none, 1 is H2H, 2 is melee, 3 is throwing, 4 is ranged, single attack, or setting trap, 5 is ranged, burst and spray, and 6 is equip.
- cost The cost of the action.
Returns:
-
None.
- improver:ClearAPCT ()
-
ClearAPCT will clear the default list of action point cost types in the game, allowing a modification to redefine all available action point types.
A mod will typically use this function to redefine or replace existing action point cost types in the game.
Returns:
-
None.
- improver:AddAPCT (name, purpose, type, cost)
-
AddAPCT will add a new action point cost type to the current list.
Parameters:
- name The name of the new action point cost type.
- purpose The action type purpose value. 0 is general, 1 is combat, 2 is treatment or repair.
- type The type of action. 0 is none, 1 is H2H, 2 is melee, 3 is throwing, 4 is ranged, single attack, or setting trap, 5 is ranged, burst and spray, and 6 is equip.
- cost The cost of the action.
Returns:
-
None.
- improver:ClearAPCT ()
-
ClearAPCT will clear the default list of action point cost types in the game, allowing a modification to redefine all available action point types.
A mod will typically use this function to redefine or replace existing action point cost types in the game.
Returns:
-
None.
- improver:AddArmourType (name)
-
AddArmourType will add a new armour type to the current list.
Note that in the Lua interface, the other parameters are not set here; they are instead set by using AddArmourRule and AddSoundRule. See those functions for
information on how to define rules for the new armour type.
Parameters:
- name The name of the new armour type.
Returns:
-
None.
- improver:ClearArmourTypes ()
-
ClearArmourTypes will clear the default list of armour types in the game, allowing a modification to redefine all available armour types.
A mod will typically use this function to redefine or replace existing armour types in the game.
Returns:
-
None.
Armour rule functions
These functions are used to set rules for which sprite and sound effect prefix to use, based on a character's armour, sex/gender, and race.
Each rule contains a string that is matched against the three attributes listed, with an asterisk '*' as a wildcard to match any value.
Rules are processed in the order they are created, with internal default rules coming first, unless they are disabled. The first rule
that matches successfully is the one which determines the final sprite or sound name, based on the output string of that rule. In
the output string, the character's armour type, sex/gender, and race values can be inserted in the string using '%a', '%s', and '%r' respectively.
Usage:
The default sprite rules are listed below, in the format "(armour,sex,race)=output": (None,*,*)=sprites/characters/%a.spr (Leather,*,*)=sprites/characters/%a%s.spr (Metal,*,*)=sprites/characters/%a%s.spr (Environmental,*,*)=sprites/characters/%a.spr (Power,*,*)=sprites/characters/%a.spr (Raider,*,*)=sprites/characters/%a%s.spr (Reaver,*,*)=sprites/characters/%a%s.spr (Ghoul,*,*)=sprites/characters/GhoulArmour.spr (Mutant,*,*)=sprites/characters/MutantArmour.spr (Brahmin,*,BOS)=sprites/critters/TwoHeadedBrahmin.spr (Brahmin,*,Tribal)=sprites/critters/TwoHeadedBrahmin.spr (Brahmin,*,Raider)=sprites/critters/TwoHeadedBrahmin.spr (Brahmin,*,Reaver)=sprites/critters/TwoHeadedBrahmin.spr (Brahmin,*,CitizenAlpha)=sprites/critters/TwoHeadedBrahmin.spr (Brahmin,*,CitizenThin)=sprites/critters/TwoHeadedBrahmin.spr (Brahmin,*,CitizenMedium)=sprites/critters/TwoHeadedBrahmin.spr (Brahmin,*,VaultZero)=sprites/critters/TwoHeadedBrahmin.spr (*,*,BOS)=sprites/characters/Tribal%s.spr (*,*,Raider)=sprites/characters/Raider%s.spr (*,*,Reaver)=sprites/characters/Reaver%s.spr (*,*,Ghoul)=sprites/characters/Ghoul.spr (*,*,Mutant)=sprites/characters/Mutant.spr (*,*,TribalLarge)=sprites/characters/TribalMaleLarge.spr (*,*,RaiderLarge)=sprites/characters/RaiderMaleLarge.spr (*,*,RaiderHuge)=sprites/characters/RaiderMaleHuge.spr (*,*,ReaverHuge)=sprites/characters/Reaver%s.spr (*,*,BOSScribe)=sprites/characters/BOSScribe.spr (*,*,BOSElder)=sprites/characters/BOSElder.spr (*,*,CitizenAlpha)=sprites/characters/CitizenAlpha.spr (*,*,CitizenThin)=sprites/characters/CitizenThin%s.spr (*,*,CitizenMedium)=sprites/characters/CitizenMedium%s.spr (*,*,VaultZero)=sprites/characters/Vault%s.spr (*,*,PipBoy)=sprites/characters/Pipboy.spr (*,*,Dummy)=sprites/characters/Dummy.spr (*,*,Deathclaw)=sprites/critters/DeathClaw.spr (*,*,DeathclawBaby)=sprites/critters/DeathClawBaby.spr (*,*,BDCSmall)=sprites/critters/SDC.spr (*,*,BDCLarge)=sprites/critters/BDC.spr (*,*,Dog)=sprites/critters/MutantDog.spr (*,*,Wasp)=sprites/critters/Wasp.spr (*,*,Radscorpion)=sprites/critters/RadScorpion.spr (*,*,Rat)=sprites/critters/GiantRat.spr (*,*,Brahmin)=sprites/critters/TwoHeadedBrahmin.spr (*,*,Komodo)=sprites/critters/MutantLizard.spr (*,*,Wolf)=sprites/critters/Wolf.spr (*,*,RobotHumanoid)=sprites/robots/Humanoid.spr (*,*,RobotPacification)=sprites/robots/Pacification.spr (*,*,RobotLifter)=sprites/robots/LoadLifter.spr (*,*,RobotHover)=sprites/robots/SmallHover.spr (*,*,RobotTank)=sprites/robots/MTT.spr (*,*,RobotBehemoth)=sprites/robots/Behemoth.spr (*,*,RobotSecurity)=sprites/robots/Security.spr (*,*,RobotScurry)=sprites/robots/Scurry.spr The default sound prefix rules are listed below: (None,*,*)=Leath (Leather,*,*)=Leath (Metal,*,*)=Metal (Environmental,*,*)=Metal (Power,*,*)=Pow (Raider,*,*)=Leath (Reaver,*,*)=Metal (Ghoul,*,*)=Leath (Mutant,*,*)=Metal (Brahmin,*,*)=Leath (*,*,Reaver)=Metal (*,*,ReaverHuge)=Metal (*,*,Raider)=Leath (*,*,RaiderLarge)=Leath (*,*,RaiderHuge)=Leath There are other sound prefix rules that are completely hardcoded, and applied if there is no match: The CyborgGeneral sprite uses Pow The BrainJar sprite uses Metal The GunTurret01 race uses Metal Otherwise, a living target uses Flesh, and a non-living target uses Pow
- improver:AddArmourRule (armour, sex, race, output)
-
AddArmourRule will add a new armour sprite rule.
Parameters:
- armour The name of the armour type for the rule, or * to match all armour types.
- sex The sex/gender of the character to apply the rule to, or * to match all.
- race The race of the character to apply the rule to, or * to match all.
- output A string indicating the name of the sprite to use (with wildcards as described).
Returns:
-
None.
- improver:AddSoundRule (armour, sex, race, output)
-
AddSoundRule will add a new armour sound rule.
Parameters:
- armour The name of the armour type for the rule, or * to match all armour types.
- sex The sex/gender of the character to apply the rule to, or * to match all.
- race The race of the character to apply the rule to, or * to match all.
- output A string indicating the name of the sprite to use (with wildcards as described).
Returns:
-
None.
- improver:DisableDefaultArmourRules ()
-
DisableDefaultArmourRules will remove the built-in armour sprite and sound rules defined in the game code.
This is useful if a mod wants to completely change how sprites and sounds are applied depending on armour,
sex/gender, and race.
Returns:
-
None.